package com.app.controller.miniProgram;


import com.app.service.UserService;
import com.app.util.Result;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Data
@Controller
@RequestMapping("/api/login")
public class LoginController {

    @Autowired
    UserService userService;

    //登录
    @GetMapping("/doLogin")
    public Result<Object> doLogin(
            @RequestParam(required = false) String code, @RequestParam(value = "code1") String code1) {
        Object obj = userService.doLogin(code, code1);
        return Result.success(obj);
    }

    @GetMapping("/whiteList")
    public Result<Object> whiteList(){
        return Result.success(userService.whiteList());
    }
}